package servlet;

import bean.ScreeningSchedule;
import service.ScreeningScheduleService;
import service.impl.ScreeningScheduleServiceImpl;

import javax.servlet.*;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.*;
import java.io.IOException;
@WebServlet("/user/get_screeningSchedule")
public class GetScreeningScheduleServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String screeningScheduleIdStr = request.getParameter("screeningScheduleId");
        System.out.println("放映编号："+screeningScheduleIdStr);
        int screeningScheduleId = Integer.parseInt(screeningScheduleIdStr);
        System.out.println(screeningScheduleId);
        ScreeningScheduleService screeningScheduleService = new ScreeningScheduleServiceImpl();
       ScreeningSchedule screeningSchedule  = screeningScheduleService.getScreeningScheduleById(screeningScheduleId);
        System.out.println("上传域对象的的screeningSchedule" + screeningSchedule);
       request.getSession().setAttribute("screeningSchedule",screeningSchedule);
    }
}
